﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Windows.Forms;
using Flagwind.Data;

namespace Flagwind.Utilities.DataBuilder
{
	internal static class Utility
	{
		#region 私有字段

		private static string _appVersion;

		#endregion

		#region 公共属性

		/// <summary>
		/// 获取当前选择的数据访问提供程序。
		/// </summary>
		public static IDataProvider DataProvider
		{
			get;
			set;
		}

		/// <summary>
		/// 获取当前应用程序版本。
		/// </summary>
		public static String AppVersion
		{
			get
			{
				if(_appVersion == null)
				{
					var version = Application.ProductVersion.Split('.');

					_appVersion = string.Format("{0}.{1}.{2}", version[0], version[1], version[2]);
				}

				return _appVersion;
			}
		}

		#endregion
	}
}
